package com.cardone.platform.configuration.service;

import java.util.List;
import java.util.Map;

import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

import com.cardone.common.cache.support.CacheEvictSupport;
import com.cardone.common.dto.PaginationDto;
import com.cardone.common.cache.Caches;
import com.cardone.platform.configuration.dto.DictionaryTypeDto;

/**
 * 字典类型服务
 *
 * @author yaohaitao
 */
public interface DictionaryTypeService {
	/**
	 * spring bean id
	 */
	String BEAN_ID = "com.cardone.platform.configuration.service.DictionaryTypeService";

	/**
	 * 保存:字典类型
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param saveDictionaryType
	 *            字典类型对象
	 * 
	 * @return 字典类型对象
	 */
	@Deprecated
	@CacheEvict(value = DictionaryTypeService.BEAN_ID, allEntries = true)
	<P> P saveByIdOrCode(Class<P> mappedClass, DictionaryTypeDto saveDictionaryType);

	/**
	 * 保存:字典类型
	 * 
	 * @param saveDictionaryType
	 *            字典类型对象
	 * 
	 * @return 字典类型对象
	 */
	@Deprecated
	@CacheEvict(value = DictionaryTypeService.BEAN_ID, allEntries = true)
	DictionaryTypeDto saveByIdOrCode(DictionaryTypeDto saveDictionaryType);

	/**
	 * 插入
	 * 
	 * @param insertDictionaryType
	 *            字典类型对象
	 * 
	 * @return 影响行数
	 */
	@Deprecated
	@CacheEvict(value = DictionaryTypeService.BEAN_ID, allEntries = true)
	int insertByCode(DictionaryTypeDto insertDictionaryType);
	
	/**
	 * 删除
	 * 
	 * @param deleteDictionaryType
	 *            字典类型对象
	 * 
	 * @return 影响行数
	 */
	@Deprecated
	@CacheEvict(value = DictionaryTypeService.BEAN_ID, allEntries = true)
	int deleteByIds(DictionaryTypeDto deleteDictionaryType);

	/**
	 * 更新
	 * 
	 * @param updateDictionaryType
	 *            字典类型对象
	 * 
	 * @return 影响行数
	 */
	@Deprecated
	@CacheEvict(value = DictionaryTypeService.BEAN_ID, allEntries = true)
	int updateByCode(DictionaryTypeDto updateDictionaryType);

	/**
	 * 查询
	 * 
	 * @param requiredType
	 *            返回类型
	 * 
	 * @param readDictionaryType
	 *            字典类型对象
	 * @return 返回数据
	 */
	@Deprecated
	@Cacheable(value = DictionaryTypeService.BEAN_ID, key = Caches.KEY_1)
	Integer readByCodeNqIdForCount(DictionaryTypeDto readDictionaryType);
	
	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param findDictionaryType
	 *            字典类型对象
	 * @return 返回对象
	 */
	@Deprecated
	@Cacheable(value = DictionaryTypeService.BEAN_ID, key = Caches.KEY_2)
	<P> P findById(Class<P> mappedClass, DictionaryTypeDto findDictionaryType);

	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param findDictionaryType
	 *            字典类型对象
	 * 
	 * @return 返回对象
	 */
	@Deprecated
	@Cacheable(value = DictionaryTypeService.BEAN_ID, key = Caches.KEY_2)
	<P> P findByCodeOrId(Class<P> mappedClass, DictionaryTypeDto findDictionaryType);

	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param findListDictionaryType
	 *            字典类型对象
	 * 
	 * @return 字典类型对象集合
	 */
	@Deprecated
	@Cacheable(value = DictionaryTypeService.BEAN_ID, key = Caches.KEY_2)
	<P> List<P> findListByLikeCode(Class<P> mappedClass, DictionaryTypeDto findListDictionaryType);

	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @return 字典类型对象集合
	 */
	@Deprecated
	@Cacheable(value = DictionaryTypeService.BEAN_ID, key = Caches.KEY_1)
	<P> List<P> findList(Class<P> mappedClass);

	/**
	 * 分页
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param paginationDictionaryType
	 *            字典类型对象
	 * 
	 * @return 字典类型分页对象
	 */
	@Deprecated
	@Cacheable(value = DictionaryTypeService.BEAN_ID, key = Caches.KEY_2)
	<P> PaginationDto<P> paginationByLikeCode(Class<P> mappedClass, DictionaryTypeDto paginationDictionaryType);
}